#ifndef SETTINGSDIALOG_H
#define SETTINGSDIALOG_H

#include <QtGui/QDialog>

class TabsView;
class ColorButton;
class QCheckBox;
class QSpinBox;
class QFontComboBox;
class QSettings;
class QComboBox;
class QLabel;

class SettingsDialog : public QDialog
{
	Q_OBJECT
	signals:
		void settingsChanged();
	public:
		SettingsDialog(QWidget *parent = 0);
		~SettingsDialog();
	private slots:
		void tabChanged(QWidget *currentWidget);
	
		void setWhenTheProgramStartAction(int index);
		void setSaveSessionWhenClose(bool save);
		void setCurrentFont(const QFont& font);
		void setCurrentFontSize(int size);
		void setTabSize(int size);
		void setReplaceTabsWithSpaces(bool toReplace);
		void setShowIndents(bool show);
		void setShowLinesNumbers(bool show);
		void setAdjustText(bool adjust);
		void setHighlightLine(bool highlight);
		void setCurrentLineColor();
		void setAutoComplSensivity(int sensivity);
		void setAutoComplReplaceWords(bool replace);
		void setUseAutoCompletion(bool use);
	private:
		void loadSettings();
	
		QSettings *settings;
	
		// Top widget of dialog with icons and names of tabs
		TabsView *tabsView;
		
		QWidget *sessionTab;
		QComboBox *whenTheProgramStartComboBox;
		QCheckBox *saveSessionWhenCloseCheckBox;
		
		// First tab "Font"
		QWidget *editionTab;
		QFontComboBox *fontComboBox;
		QSpinBox *fontSizeSpinBox;
		QSpinBox *tabSizeSpinBox;
		QCheckBox *replaceTabsWithSpacesCheckBox;
		QCheckBox *showIndentsCheckBox;
	
		// Third tab "View"
		QWidget *viewTab;
		QCheckBox *showLinesNumbersCheckBox;
		QCheckBox *adjustTextCheckBox;
		QCheckBox *highlightLineCheckBox;
		ColorButton *currentLineColorButton;
		
		// Fourth tab "Misc"
		QWidget *autoCompletionTab;
		QCheckBox *replaceWordsCheckBox;
		QSpinBox *autoCompletionSensSpinBox;
		QCheckBox *useAutoCompletionCheckBox;
};

#endif
